package com.study.aop;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;

/**
 * @author Kevin Liu
 * @date 2020/8/18 上午10:52
 */
@Aspect
public class LogAspect {

	@Pointcut("execution(* com.study.entity.AopTest.*(..))")
	public void pointCut(){

	}

	@Around("pointCut()")
	public Object around(ProceedingJoinPoint proceedingJoinPoint) throws Throwable {
		final Object[] args = proceedingJoinPoint.getArgs();
		System.out.println(args);
		final Object proceed = proceedingJoinPoint.proceed();
		System.out.println(proceed);
		return proceed;
	}
}
